package com.smashligaprojectm;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.*;

@DatabaseTable(tableName = "JUGADOR")
public class Jugador implements Comparable<Jugador>{
	
	@DatabaseField(columnName = "NAME",useGetSet = true,unique=true,id=true)
	private String name;
	@DatabaseField(columnName = "PUNT",useGetSet = true)
	private int punt;
	@DatabaseField(columnName = "TIER",useGetSet = true,foreign = true,foreignColumnName="NOMBRE")
	private Tier tier;
	
	public Jugador(){
		
	}
	
	public Jugador(String name, int punt, Tier tier) {
		this.name = name;
		this.punt = punt;
		this.tier = tier;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getPunt() {
		return punt;
	}

	public void setPunt(int punt) {
		this.punt = punt;
	}

	public Tier getTier() {
		return tier;
	}

	public void setTier(Tier tier) {
		this.tier = tier;
	}
	
	public String toString(){
		return this.name+";"+this.punt+";"+this.tier;
	}

	@Override
	public int compareTo(Jugador o) {
		return this.name.compareTo(o.getName());
	}
}
